package com.lwj.liwanjia.presenter;

import com.lwj.liwanjia.bean.ScSelectBean;
import com.lwj.liwanjia.bean.SpPriceBean;
import com.lwj.liwanjia.impl.SpPriceView;
import com.lwj.liwanjia.model.SpPriceModel;

import java.util.Map;

import rx.Subscriber;

/**
 * Created by Administrator on 2017/10/19.
 */

public class SpPricePresenter {
    private SpPriceView spPriceView;
    private SpPriceModel spPriceModel;

    public SpPricePresenter(SpPriceView spPriceView) {
        this.spPriceView = spPriceView;
        spPriceModel = new SpPriceModel();
    }

    public void getNowPrice(Map<String, Object> map, ScSelectBean selectBean) {
        if (spPriceView != null) {
            spPriceModel.getNowPrice(map, selectBean, new Subscriber<SpPriceBean>() {
                @Override
                public void onCompleted() {

                }

                @Override
                public void onError(Throwable e) {
                }

                @Override
                public void onNext(SpPriceBean spPriceBean) {
                    spPriceView.getNowPrice(spPriceBean);
                }
            });
        }
    }
}
